package com.alex.task.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

// @Service
@Slf4j
public class ScheduledService {

    @Scheduled(cron = "0 * * * * MON-FRI")
    public void hello() {
        log.info("ScheduledService: hello 每0秒");
    }

    @Scheduled(cron = "0,3,7,9,10 * * * * MON-SAT")
    public void test02() {
        log.info("ScheduledService: 枚举 0,3,7,9,10");
    }

    @Scheduled(cron = "21-24 * * * * MON-SAT")
    public void test03() {
        log.info("ScheduledService: 区间 21-24");
    }

    @Scheduled(cron = "0/20 * * * * MON-SAT")
    public void test04() {
        log.info("ScheduledService: 步长 0/20");
    }



    @Scheduled(cron = "0 0/2 14,19,23 * * ?")
    public void test11() {
        log.info("ScheduledService: 自定义01");
    }

}
